#!/usr/bin/node

const http = require('http'),
      cp   = require('child_process');

console.log('06-pid is :', process.pid);

http.createServer((req, res) => {
  var child = cp.spawn('./03-child.js');
  child.stdout.pipe(res);
  //cp.execFile('./03-child.js', [], (err, stdout) => {
  //res.end(stdout);
  //});
}).listen(8080);

//node 06-
//新开一个窗口，运行curl http://192.168.145.129:8080
